//
//  NSString+Volidate.m
//  hcpro
//
//  Created by hc on 16/9/22.
//  Copyright © 2016年 hucai.com. All rights reserved.
//

#import "NSString+Volidate.h"

@implementation NSString (Volidate)
/** 非空验证*/
- (BOOL)stringIsNullOrEmpty{
    if (self == nil) {
        return YES;
    }
    if ([[self trim] isEqualToString:@""]) {
        return YES;
    }
    return NO;
}

/** 移除两端空格 */
- (NSString *)trim{
    NSCharacterSet *whiteSpace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
    NSString *newStr = [self stringByTrimmingCharactersInSet:whiteSpace];
    return newStr;
}
@end
